<template>
  <div class="son-box">
    <p>我叫{{ name }}</p>
    <button
      @click="$emit('call-father','我饿了')"
    >
      我饿了
    </button>
  </div>
</template>

<script>
  export default {
    //定义自定义属性,从外部传进来
    props:['name']
  }
</script>

<style lang="sass" scoped>
.son-box
  border: 2px solid #d55
  background: #f0f0f0
  padding: 10px
</style>
